package com.syh.jn.scm.infrastructure.repository.model.stock;

import com.syh.core.ddd.infrastructure.repository.model.SuperBusinessModel;
import lombok.*;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * 仓库商品库存列表
 */
@Data
@Builder
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "T_STOCK_STOCK_GOODS")
public class StockGoodsModel extends SuperBusinessModel {
  /**
   * 商品id
   */
  @Column(name = "GOODS_ID", columnDefinition = "bigint COMMENT '商品id'")
  private Long goodsId;
  /**
   * 商品名称
   */
  @Column(name = "NAME", columnDefinition = "varchar(100) COMMENT '商品名称'")
  private String name;
  /**
   * 编码
   */
  @Column(name = "CODE", columnDefinition = "varchar(50) COMMENT '编码'")
  private String code;
  /**
   * 所属种类,应用分类编码
   */
  @Column(name = "CATEGORY_CATALOG_CODE", columnDefinition = "varchar(50) COMMENT '所属种类,应用分类的父类目录'", length = 50)
  private String categoryCatalogCode;
  /**
   * 分类id
   */
  @Column(name = "CATEGORY_ID", columnDefinition = "bigint COMMENT '分类id'")
  private Long categoryId;
  /**
   * 品牌id
   */
  @Column(name = "GOODS_BRAND_ID", columnDefinition = "bigint COMMENT '品牌id'")
  private Long goodsBrandId;
  /**
   * 规格
   */
  @Column(name = "SPEC_NAME", columnDefinition = "varchar(50) COMMENT '规格'")
  private String specName;
  /**
   * 产地id
   */
  @Column(name = "ORIGIN_ID", columnDefinition = "bigint COMMENT '产地id'")
  private Long originId;
  /**
   * 生产商id
   */
  @Column(name = "MANUFACTURER_ID", columnDefinition = "bigint COMMENT '生产商id'")
  private Long manufacturerId;
  /**
   * 计量单位
   */
  @Column(name = "UNITS", columnDefinition = "varchar(50) COMMENT '计量单位'")
  private String units;
  /**
   * 仓库id
   */
  @Column(name = "STOREHOUSE_ID", columnDefinition = "bigint COMMENT '仓库id'")
  private Long storehouseId;
  /**
   * 期初数量
   */
  @Column(name = "BEGINNING_COUNT", columnDefinition = "decimal(19,2) COMMENT '期初数量'")
  private BigDecimal beginningCount;
  /**
   * 期初均价
   */
  @Column(name = "BEGINNING_AVG_UNIT_PRICE", columnDefinition = "decimal(19,2) COMMENT '期初均价'")
  private BigDecimal beginningAvgUnitPrice;
  /**
   * 库存数量
   */
  @Column(name = "QUANTITY", columnDefinition = "decimal(19,2) COMMENT '库存数量'")
  private BigDecimal quantity;
  /**
   * 平均成本
   */
  @Column(name = "AVERAGE_COST", columnDefinition = "decimal(19,6) COMMENT '平均成本'")
  private BigDecimal averageCost;
  /**
   * 库存余额
   */
  @Column(name = "BALANCE", columnDefinition = "decimal(19,2) COMMENT '库存余额'")
  private BigDecimal balance;

  /**
   * 是否可用: -1停用,1可用
   */
  @Column(name = "STATUS", columnDefinition = "smallint COMMENT '是否可用: -1停用,1可用'")
  private Short status;
  /**
   * 与基础商品转换率（如果是基础商品 则等于1）
   */
  @Column(name = "CONVERSION_RATE", columnDefinition = "decimal(19,2) COMMENT '与基础商品转换率（如果是基础商品 则等于1）'")
  private BigDecimal conversionRate;
}
